{extend name="Public:base" /}

             {block name="seo"}
        <title>找回密码|{$Think.CONFIG.WEB_SITE_TITLE} - Powered by EasySNS!</title>
  
  
  <meta name="keywords" content="{$Think.CONFIG.WEB_SITE_KEYWORD}">
  <meta name="description" content="{$Think.CONFIG.WEB_SITE_DESCRIPTION}">
      {/block}
        {block name="css"}
     <link rel="stylesheet" type="text/css" href="__CSS__/user.css" />
      {/block}
{block name="body"}
<div class="login">
	
		<div class="main  container">
			<div class="mainLeft">
				<h3><span class="active">重置密码</span></h3>
				<div class="fly-msg">{$username}，请重置您的密码</div>

    <div class="form-group"  style="overflow:hidden;margin-top:40px">
    <label for="inputPassword3" class="col-sm-3 control-label">密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="password" name="password" placeholder="密码6-30个字符">
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-3 control-label">确认密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="repassword" name="repassword" placeholder="重复密码">
    </div>
  </div>
 <input type="hidden" class="form-control" id="salt" value="{$salt}" />
  <input type="hidden" class="form-control" id="uid" value="{$userid}" />
  <div class="form-group">
    <div class="col-sm-offset-3 col-sm-6" style="margin-top:40px">
      <a id="submit" href="javascript:;" class="btn btn-success  btn-block">登 录</a>
    </div>
  </div>

			</div>
			<div class="mainRight">
				
				
				
			</div>
		</div>
	</div>
  
{/block}

{block name="script"}
<script>
$('#submit').click(function(){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var password = $('#password').val();
    var repassword = $('#repassword').val();
    var uid = $('#uid').val();
    var salt = $('#salt').val();
    
    if(password==repassword){
        $.post('{:url("User/resetpass")}',{'password':password,'uid':uid,'salt':salt},function(data){
            if(data.code == 1){
              layer.close(loading);
              layer.msg(data.msg, {icon: 1, time: 1000}, function(){
              	location.href = '{:url("user/login")}';
              });
            }else{
              layer.close(loading);
              layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
             
            }
          });
    }else{
    	  layer.close(loading);
    	 layer.msg('两次密码输入不一致', {icon: 2, anim: 6, time: 1000});
    }
    

    return false;
  });

</script>{/block}